package com.mornd.gulimall.common.core.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author: mornd
 * @dateTime: 2023/7/29 - 22:27
 * 分页参数
 */

@Getter
@Setter
public class PageEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private Long pageNum;

    @TableField(exist = false)
    private Long pageSize;

    public Long validPageNum() {
        return pageNum == null ? 1L : pageNum;
    }

    public Long validPageSize() {
        return pageSize == null ? 10L : pageSize;
    }
}
